
public class Job {

	private State state;
	private int priority, jobNumber;
	private int arrTime;
	private int cpuTime, pr1Time, pr2Time, ddTime;
	private int age, agingStartTime;
	
	private int beginQueueTime; //used for finding waiting time
	private int waitTime, responseTime, turnAroundTime;
	private double probdd, probpr1, probpr2;
	private int ddavg, pr1avg, pr2avg;
	private boolean isFirstTime;

	private int quantaLimit; //how long process can use CPU
	
	public Job(int arrivalTime, int serviceTime){
		state = State.NEW;
		this.arrTime = arrivalTime;
		this.cpuTime = serviceTime;
		isFirstTime = true;
	}
	
	public Job(){
		this(0,0);
	}

	public void addWaitTime(int clock){
		waitTime += (clock - beginQueueTime);
	}
	
	public void deductCpu(){
		cpuTime -= 1;
	}
	
	public void deductPr1(){
		pr1Time -= 1;
	}
	
	public void deductPr2(){
		pr2Time -= 1;
	}
	
	public void deductDD(){
		ddTime -= 1;
	}
	
	public void deductQuanta(){
		quantaLimit -= 1;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public int getArrTime() {
		return arrTime;
	}

	public void setArrTime(int arrTime) {
		this.arrTime = arrTime;
	}

	public int getCpuTime() {
		return cpuTime;
	}

	public void setCpuTime(int cpuTime) {
		this.cpuTime = cpuTime;
	}

	public int getPr1Time() {
		return pr1Time;
	}

	public void setPr1Time(int pr1Time) {
		this.pr1Time = pr1Time;
	}

	public int getPr2Time() {
		return pr2Time;
	}

	public void setPr2Time(int pr2Time) {
		this.pr2Time = pr2Time;
	}

	public int getDdTime() {
		return ddTime;
	}

	public void setDdTime(int ddTime) {
		this.ddTime = ddTime;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public double getProbdd() {
		return probdd;
	}

	public void setProbdd(double probdd) {
		this.probdd = probdd;
	}

	public double getProbpr1() {
		return probpr1;
	}

	public void setProbpr1(double probpr1) {
		this.probpr1 = probpr1;
	}

	public double getProbpr2() {
		return probpr2;
	}

	public void setProbpr2(double probpr2) {
		this.probpr2 = probpr2;
	}

	public int getDdavg() {
		return ddavg;
	}

	public void setDdavg(int ddavg) {
		this.ddavg = ddavg;
	}

	public int getPr1avg() {
		return pr1avg;
	}

	public void setPr1avg(int pr1avg) {
		this.pr1avg = pr1avg;
	}

	public int getPr2avg() {
		return pr2avg;
	}

	public void setPr2avg(int pr2avg) {
		this.pr2avg = pr2avg;
	}

	public int getQuantaLimit() {
		return quantaLimit;
	}

	public void setQuantaLimit(int quantaLimit) {
		this.quantaLimit = quantaLimit;
	}

	public int getWaitTime() {
		return waitTime;
	}

	public void setWaitTime(int waitTime) {
		this.waitTime = waitTime;
	}

	public int getResponseTime() {
		return responseTime;
	}

	public void setResponseTime(int responseTime) {
		this.responseTime = responseTime;
	}

	public int getTurnAroundTime() {
		return turnAroundTime;
	}

	public void setTurnAroundTime(int turnAroundTime) {
		this.turnAroundTime = turnAroundTime;
	}

	public int getBeginQueueTime() {
		return beginQueueTime;
	}

	public void setBeginQueueTime(int beginQueueTime) {
		this.beginQueueTime = beginQueueTime;
	}

	public boolean isFirstTime() {
		return isFirstTime;
	}

	public void setFirstTime(boolean isFirstTime) {
		this.isFirstTime = isFirstTime;
	}
	
	
	public void setJobNumber(int jobNumber){
		this.jobNumber = jobNumber;
	}
	
	public int getJobNumber(){
		return jobNumber;
	}
	
	public void setAgingStartTime(int agingTime){
		this.agingStartTime = agingTime;
	}
	
	public int getAgingStartTime(){
		return agingStartTime;
	}
}
